
def pair(args):
	for i in range(len(args)):
		yield (args[i], args[-i-1])

#agents
players = ['mobstabab', 'most', 'scoreab', 'smartscoremax', 'stabab', 'mobplusab', 'mobstab', 'stabmax', 'mostab', 'greedystab', 'smartscoreab', 'scoremax']
score = {'mobstabab':0,
	 'most':0,
	 'scoreab':0,
	 'smartscoremax':0,
	 'stabab':0,
	 'mobplusab':0,
	 'mobstab':0,
	 'stabmax':0,
	 'mostab':0,
	 'greedystab':0,
	 'smartscoreab':0,
	 'scoremax':0}

stats = open('results.txt','w')

for p1, p2 in pair(players):
	out = open('%s-Vs-%s-1000.txt'%(p1, p2))
	for line in out:
		if line[:5] == "Black":
			score[p1] += 1
		elif line[:5] == "White":
			score[p2] += 1
	out.close()

for player in players:
	stats.write("%s:  %d\n" % (player, score[player]))

stats.close()